/**
 * Project Name:九色鹿
 * File Name:RandomNameTool.java
 * Package Name:com.fxp.project.jiuselu.commons.name
 * Date:2020年04月06日 11:15
 * Copyright (c) 2020, Jason.Wang All Rights Reserved.
 */
package com.fxp.project.jiuselu.commons.name;

import com.fxp.project.jiuselu.commons.name.en.EnglishNameUtil;
import com.fxp.project.jiuselu.commons.name.util.NameType;
import com.fxp.project.jiuselu.commons.name.zh.SimpleZhNameUtil;

/**
 * ClassName:RandomNameTool<br/>
 * Function: 随机生成姓名的工具类<br/>
 * Date:2020年04月06日 11:15<br/>
 *
 * @author Jason.Wang
 * @version 1.0.0.0
 * @see
 * @since JDK1.8
 */
public class RandomNameTool {

    /**
     * getName: 公开的调用方法<br/>
     *
     * @param language
     * @param flag
     * @return
     * @author Jason.Wang
     * @createTime 2020/4/6 11:48
     */
    public static String getName(Language language, int flag) {
        String name;
        switch (language) {
            case zh:
                name = getZhName(flag);
                break;

            default:
                name = getEnglishName(flag);
                break;
        }
        return name;
    }

    /**
     * getZhName: 创建中文名称<br/>
     *
     * @param flag
     * @return
     * @author Jason.Wang
     * @createTime 2020/4/6 11:49
     */
    private static String getZhName(int flag) {
        if (flag == NameType.FULL_NAME) {
            return SimpleZhNameUtil.getFullName();
        }
        return SimpleZhNameUtil.getSimpleName();

    }

    /**
     * getEnglishName: 创建英文名称<br/>
     *
     * @param flag
     * @return
     * @author Jason.Wang
     * @createTime 2020/4/6 11:49
     */
    private static String getEnglishName(int flag) {
        if (flag == NameType.FULL_NAME) {
            return EnglishNameUtil.getFullName();
        }
        return EnglishNameUtil.getSimpleName();
    }
}
